<?php
	function selectPB($tenpb) {
		$data = new DBAccess();
		$sql = "select * from phongban where tenpb like '%$tenpb%' ";
		$rs = $data->executeNonQuery($sql);
		return $rs;
	}
	function insertPB($tenpb,$chuvt)
	{
		$data = new DBAccess();
		$sql = "insert into phongban (tenpb,chuviettat)values('$tenpb','$chuvt')";
		$rs = $data->executeNonQuery($sql);
		return $rs;
	}
	function updatePB($tenpb,$chuvt,$mapb)
	{
		$data = new DBAccess();
		$sql = "update phongban set tenpb ='$tenpb', chuviettat ='$chuvt' where mapb = '$mapb' ";
		$rs = $data->executeNonQuery($sql);
		return $rs;
	}
	function deletePB($mapb)
	{
		$data = new DBAccess();
		$sql = "delete from phongban where mapb ='$mapb'";
		$rs = $data->executeNonQuery($sql);
		return $rs;
	}
	function checkPB($tenpb) {
		$data = new DBAccess();
		$sql = "select * from phongban where tenpb ='$tenpb'";
		$rs = $data->executeNonQuery($sql);
		return $rs;
	}
?>